<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" isELIgnored="false" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>


<div class="form-control-free" style="overflow-y:auto; overflow-x:auto; max-height: 370px;  padding-left: 200px ">
    <div class="col-sm-offset-1 col-sm-8">
        <ul id="treeDemo" class="ztree"></ul>
    </div>
    <div class="col-sm-2">

        <c:choose>
            <c:when test="${isEdit==false}">
                <button style="margin-left:-5px" type="button" id="btn_update_expertMajor" class="btn btn-default"><span
                        class="glyphicon glyphicon-edit"></span> 修改
                </button>
            </c:when>

            <c:otherwise>
                <button style="margin-left:-5px" type="button" id="btn_cancel_expertMajor"
                        class="btn btn-default btn-danger"><span
                        class="glyphicon glyphicon-remove"></span> 撤销
                </button>
            </c:otherwise>
        </c:choose>
    </div>
</div>


<script>
    $("#btn_update_expertMajor").click(function () {
        $('#modal_ajax').modal({
            backdrop: 'static',
            keyboard: false,
            show: true,
            remote: 'expertInfo/expertEdit/expertMajor/editDlg'
        });
    });
    $("#btn_cancel_expertMajor").click(function () {
        $.sysPlugin.superAjax({
            url: 'expertInfo/expertEdit/expertMajor/cancelApply',
            operateType: '撤销申请',
            showSuccessAlert: true,
            showWarnAlert: true,
            successCall: function (data) {
                refreshTab($("#tab_expertMajor"));
            }
        });
    });
</script>
<SCRIPT type="text/javascript">
    var setting = {
        data: {
            simpleData: {
                enable: true
            }

        },


    };
    var zNodes =${data};
    $(document).ready(function () {
        $.fn.zTree.init($("#treeDemo"), setting, zNodes);
        //展开第一级
        var treeObj = $.fn.zTree.getZTreeObj("treeDemo");
        $.each(treeObj.getNodes(), function (i, v) {
            console.log(v);
            treeObj.expandNode(v, true, false, true);
        });
    });
</SCRIPT>